//
//  UIView+WENExtension.m
//  仿百思不得姐
//
//  Created by wen on 2018/2/12.
//  Copyright © 2018年 wen. All rights reserved.
//

#import "UIView+WENExtension.h"

@implementation UIView (WENExtension)

//X
-(CGFloat)x
{
    return self.frame.origin.x;
}
-(void)setX:(CGFloat)x
{
    CGRect frame = self.frame;
    frame.origin.x = x;
    self.frame = frame;
}


//Y
-(CGFloat)y
{
    return self.frame.origin.x;
}
-(void)setY:(CGFloat)y
{
    CGRect frame = self.frame;
    frame.origin.y = y;
    self.frame = frame;
}


//height
-(CGFloat)height
{
    return self.frame.size.height;
}
-(void)setHeight:(CGFloat)height
{
    CGRect frame = self.frame;
    frame.size.height = height;
    self.frame = frame;
}


//width
-(CGFloat)width
{
    return self.frame.size.width;
}
-(void)setWidth:(CGFloat)width
{
    CGRect frame = self.frame;
    frame.size.width = width;
    self.frame = frame;
}


//centerX
-(CGFloat)centerX
{
    return self.centerX;
}

-(void)setCenterX:(CGFloat)centerX
{
    self.centerX = centerX;
}


//centerY
-(CGFloat)centerY
{
    return self.centerY;
}

-(void)setCenterY:(CGFloat)centerY
{
    self.centerY = centerY;
}


@end
